package com.parleys.service.intf;

import java.util.List;

import com.parleys.domain.Channel;
import com.parleys.domain.Presentation;
import com.parleys.domain.PresentationAsset;
import com.parleys.domain.Space;

/**
 * Handles every interaction with the database. The database is used in the offline part of the application
 * 
 * @author David Van Droogenbroeck
 * 
 */
public interface DBAdapter {

	void openForReading();

	void openForWriting();

	void close();

	long insertSpace(Space space);

	List<Space> getAllSpaces();

	long insertChannelForSpace(Channel channel, Integer spaceId);

	List<Channel> getAllChannelsForSpace(Integer spaceId);

	long insertPresentationForChannelId(Presentation presentation, Integer channelId);

	List<Presentation> getAllPresentationsForChannelId(Integer channelId);

	List<Presentation> getDownloadedPresentations();

	List<Presentation> searchPresentation(String searchString);

	boolean isPresentationPresentInDb(Integer presentationId);

	long insertAssetForPresentationId(PresentationAsset asset, Integer presentationId);

	List<PresentationAsset> getAllAssetsForPresentationId(Integer presentationId);

}
